package com.cntcdt.api.db.model.base;

import java.io.Serializable;
import java.sql.ResultSet;
import java.util.Date;

/**
 * 这是cdt_shop的数据传输对象基类,直接与表对应<br>
 */
public abstract class ShopModelBase implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 属性:id<br>
	 */
	private Integer id;
	/**
	 * 属性:name<br>
	 */
	private String name;
	/**
	 * 属性:address<br>
	 */
	private String address;
	/**
	 * 属性:tel<br>
	 */
	private String tel;
	/**
	 * 属性:contact<br>
	 */
	private String contact;
	/**
	 * 属性:lat<br>
	 */
	private Double lat;
	/**
	 * 属性:lng<br>
	 */
	private Double lng;
	/**
	 * 属性:cityId<br>
	 */
	private Integer cityId;
	/**
	 * 属性:addTime<br>
	 */
	private Date addTime;
	/**
	 * 属性:updateTime<br>
	 */
	private Date updateTime;

	private Long sortTime;

	private int type;

	private String navAddress;// 导航地址

	private String logo;// 商家logo

	private Integer opStatus;

	private String cooperationPhone;

	private String customerServicePhone;

	/**
	 * 默认构造方法,构造一个默认的ShopModelBase对象
	 */
	public ShopModelBase() {
	}

	/**
	 * 构造函数
	 * 
	 * @param rs
	 *            数据库查询结果集
	 */
	public ShopModelBase(ResultSet rs) {
		try {
			this.id = rs.getInt("id");
			this.name = rs.getString("name");
			this.address = rs.getString("address");
			this.tel = rs.getString("tel");
			this.contact = rs.getString("contact");
			this.lat = rs.getDouble("lat");
			this.lng = rs.getDouble("lng");
			this.cityId = rs.getInt("cityId");
			this.addTime = rs.getDate("addTime");
			this.updateTime = rs.getDate("updateTime");
			this.sortTime = rs.getLong("sortTime");
			this.type = rs.getInt("type");
			this.navAddress = rs.getString("navAddress");
			this.logo = rs.getString("logo");
			this.opStatus = rs.getInt("opStatus");
			this.cooperationPhone = rs.getString("cooperationPhone");
			this.customerServicePhone = rs.getString("customerServicePhone");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public String getCooperationPhone() {
		return cooperationPhone;
	}

	public void setCooperationPhone(String cooperationPhone) {
		this.cooperationPhone = cooperationPhone;
	}

	public String getCustomerServicePhone() {
		return customerServicePhone;
	}

	public void setCustomerServicePhone(String customerServicePhone) {
		this.customerServicePhone = customerServicePhone;
	}

	/**
	 * 设置属性id<br>
	 * 
	 * @param id
	 *            待设置的属性id的值
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * 获取属性id<br>
	 * 
	 * @return 属性id的值
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * 设置属性name<br>
	 * 
	 * @param name
	 *            待设置的属性name的值
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 获取属性name<br>
	 * 
	 * @return 属性name的值
	 */
	public String getName() {
		return name;
	}

	/**
	 * 设置属性address<br>
	 * 
	 * @param address
	 *            待设置的属性address的值
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * 获取属性address<br>
	 * 
	 * @return 属性address的值
	 */
	public String getAddress() {
		return address;
	}

	/**
	 * 设置属性tel<br>
	 * 
	 * @param tel
	 *            待设置的属性tel的值
	 */
	public void setTel(String tel) {
		this.tel = tel;
	}

	/**
	 * 获取属性tel<br>
	 * 
	 * @return 属性tel的值
	 */
	public String getTel() {
		return tel;
	}

	/**
	 * 设置属性contact<br>
	 * 
	 * @param contact
	 *            待设置的属性contact的值
	 */
	public void setContact(String contact) {
		this.contact = contact;
	}

	/**
	 * 获取属性contact<br>
	 * 
	 * @return 属性contact的值
	 */
	public String getContact() {
		return contact;
	}

	/**
	 * 设置属性lat<br>
	 * 
	 * @param lat
	 *            待设置的属性lat的值
	 */
	public void setLat(Double lat) {
		this.lat = lat;
	}

	/**
	 * 获取属性lat<br>
	 * 
	 * @return 属性lat的值
	 */
	public Double getLat() {
		return lat;
	}

	/**
	 * 设置属性lng<br>
	 * 
	 * @param lng
	 *            待设置的属性lng的值
	 */
	public void setLng(Double lng) {
		this.lng = lng;
	}

	/**
	 * 获取属性lng<br>
	 * 
	 * @return 属性lng的值
	 */
	public Double getLng() {
		return lng;
	}

	/**
	 * 设置属性cityId<br>
	 * 
	 * @param cityId
	 *            待设置的属性cityId的值
	 */
	public void setCityId(Integer cityId) {
		this.cityId = cityId;
	}

	/**
	 * 获取属性cityId<br>
	 * 
	 * @return 属性cityId的值
	 */
	public Integer getCityId() {
		return cityId;
	}

	/**
	 * 设置属性addTime<br>
	 * 
	 * @param addTime
	 *            待设置的属性addTime的值
	 */
	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	/**
	 * 获取属性addTime<br>
	 * 
	 * @return 属性addTime的值
	 */
	public Date getAddTime() {
		return addTime;
	}

	/**
	 * 设置属性updateTime<br>
	 * 
	 * @param updateTime
	 *            待设置的属性updateTime的值
	 */
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/**
	 * 获取属性updateTime<br>
	 * 
	 * @return 属性updateTime的值
	 */
	public Date getUpdateTime() {
		return updateTime;
	}

	/**
	 * 比较两个对象在逻辑上是否相等
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ShopModelBase)) {
			return false;
		}

		final ShopModelBase otherModel = (ShopModelBase) other;
		if (getId() != null && !getId().equals(otherModel.getId())) {
			return false;
		}
		return true;
	}

	public Long getSortTime() {
		return sortTime;
	}

	public void setSortTime(Long sortTime) {
		this.sortTime = sortTime;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	/**
	 * 根据主键生成HashCode
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		StringBuffer buffer = new StringBuffer();
		buffer.append('|').append(id);
		return buffer.toString().hashCode();
	}

	public String getNavAddress() {
		return navAddress;
	}

	public void setNavAddress(String navAddress) {
		this.navAddress = navAddress;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public Integer getOpStatus() {
		return opStatus;
	}

	public void setOpStatus(Integer opStatus) {
		this.opStatus = opStatus;
	}

}
